
package samples;
// {{{ imports
import jp.ize.ux.UXRoot;
import jp.ize.ux.UXObject;
import jp.ize.ux.events.UXMouseEvent;
import jp.ize.ux.geom.UXSize;
import jp.ize.ux.geom.UXRect;
import jp.ize.ux.geom.UXPoint;
import jp.ize.ux.components.UXImage;
import jp.ize.ux.components.UXLinearBox;
import jp.ize.ux.acts.Act;
import jp.ize.ux.acts.LinearAct;
import jp.ize.ux.tween.easings.Expo;

import jp.ize.iwp.RuntimeEngine;
import jp.ize.iwp.utils.DebugUtil;
// }}}
// {{{ class LinearBox3
class LinearBox3
{
	// {{{ public static function main()

	public static function main()
	{
		RuntimeEngine.init();
		DebugUtil.init();
		DebugUtil.setLocation( 100, 50 );
		// {{{ ex.3 shuffle
		var lineb = new UXLinearBox(new UXPoint(700,100), new UXPoint(0,200));
		// LinearLayoutのインタラクションをMouseDownで起こすことにする。
		lineb.ctrl.getInteraction("Layout").addReactEvent(UXMouseEvent.DOWN);
		lineb.x = 50;
		lineb.y = 200;
		lineb.addUXChild(new UXImage("Pref.png"));
		lineb.addUXChild(new UXImage("lambda-icon.png", new UXSize(100,100)));
		lineb.addUXChild(new UXImage("Safari.png"));
		lineb.addUXChild(new UXImage("ImageCapture.png"));
		lineb.addUXChild(new UXImage("TimeMachine.png"));
		lineb.addUXChild(new UXImage("iPhoto.png"));
		lineb.addUXChild(new UXImage("iTunes.png"));
		lineb.addUXChild(new UXImage("mail.png"));
		lineb.addUXChild(new UXImage("robot.png"));		
		UXRoot.addUXChild(lineb);

		// シャッフルによるランダムな整列を行ないます。
		var a = new LinearAct();
		var actparam:ShuffleParameter = {
			time:0.3,
			transition:Expo.easeOut,
			targets: null
		}
		lineb.ctrl.getInteraction("Layout").addAct(a.shuffle(actparam));
		// }}}
	}

	// }}}
}
// }}}
